package cn.dt.ymcc.feign;

import cn.dt.ymcc.domain.Login;
import cn.dt.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UaaLoginFeignClientFallbackFactory implements FallbackFactory<UaaLoginFeignClient> {
    @Override
    public UaaLoginFeignClient create(Throwable throwable) {
        return new UaaLoginFeignClient() {
            @Override
            public JSONResult saveOrUpdate(Login login) {
                return  JSONResult.error("Uaa服务瓦了！请稍后重试");
            }
        };
    }
}
